package com.zzl.car.controller;

import com.github.pagehelper.PageInfo;
import com.zzl.car.entity.CarBaseInfo;
import com.zzl.car.entity.CarCheckRecord;
import com.zzl.car.service.ZzwCarCheckRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class ZzwCarCheckRecordController {
    @Autowired
    private ZzwCarCheckRecordService carCheckRecordService;

    /**
     * 获取所有检查记录信息
     * @param state
     * @param currentPage
     * @return
     */
    @GetMapping("/getCarCheckRecord")
    public PageInfo<CarCheckRecord> getCarCheckRecord(@RequestParam(value = "state",required = false)Integer state,
                                                      @RequestParam(value = "currentPage",defaultValue = "1") int currentPage){
        return carCheckRecordService.getCarCheckRecord(state,currentPage);
    }

    @GetMapping("/deleteCarCheckRecord")
    public String deleteCarCheckRecord(@RequestParam("id")Integer id){
        return carCheckRecordService.deleteCarCheckRecord(id);
    }
}
